/*
 * Copyright (c) 2021. Moses All Right Reserved
 */

package com.moses.design_patterns.factory_method.f;

import com.moses.design_patterns.factory_method.IProduct;

/**
 * @author Moses
 * @email shenhuohui@gmail.com
 * @date 2021/4/11 10:50
 */
public class SimpleAbstractFactoryImpl extends SimpleAbstractFactory {
    @Override
    public IProduct getProduct(Class clz) {
        IProduct iProduct = null;
        try {
            iProduct = (IProduct) clz.newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return iProduct;
    }
}
